#pragma once
#include "sqlitelibrary.h"
#include "DBManager.h"

using namespace LIBSQLITE4CONFIGSPEACE;

class CLiteDataBase :
	public virtual SQLite4MiniDB, public virtual CFileManager, public virtual CSQLiteHandler
{
public:
	CLiteDataBase(std::string filename, std::list<std::string> columns);
	virtual ~CLiteDataBase();

	static CLiteDataBase*GetMiniDB(std::string configname, std::list<std::string> column);

	// Inherited via SQLite4MiniDB
	virtual long Insert(std::list<std::string> columns, std::list<std::string> values, bool unique = false) override;
	virtual long Update(std::list<std::string> columns, std::list<std::string> values, std::string conditions) override;
	virtual long Find(std::list<std::string> columns, std::map<std::string, std::list<std::string>>& values, std::string conditions) override;
	virtual int Remove(std::string conditions) override;

private:
	static int Sqlite4MiniDBCB(void*, int, char**, char**);
	bool Initialize();

	std::list<std::string> mColumns;
};

